import logging


__author__="Action Farsi"
__date__ ="$19-giu-2009 12.52.57$"

messages = ['','','','','','','','','','','','','','']

the_log = logging.getLogger('')

class ListHandler(logging.Handler):
    def __init__(self):
        logging.Handler.__init__(self)
        #self.counter = AfWpy.game

    def emit(self,record):
        #messages.append("%d: "%self.counter.ticks + record.getMessage())
        messages.append(record.getMessage())
        messages.pop(0)

logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s %(levelname)s %(message)s')


mex = ListHandler()
mex.setLevel(logging.INFO)
# set a format which is simpler for console use
formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
mex.setFormatter(formatter)
# add the handler to the root logger
logging.getLogger('').addHandler(mex)



if __name__ == "__main__":
    print "Hello";